package vv.lines.utils;

import vv.lines.core.Ball;
import vv.lines.core.Cell;

/**
 * @author vpotapenko
 */
public class LinesUtils {

    public static boolean isValidMoving(Cell source, Cell target, Ball ball) {
        return source != null && target != null && ball != null && source != target;
    }

    public static boolean equalsBall(Cell cell, Cell currCell) {
        return !isEmpty(currCell) && currCell.getBall().sameValue(cell.getBall());
    }

    private static boolean isEmpty(Cell cell) {
        return cell == null || cell.getBall() == null;
    }
}
